<?php
include('../../inc/global.inc');
include("../islogin.php");
$url="unvalid.php";

?>
<?php
if(isset($_GET["id"]))
{
	$id = $_GET["id"];
	if(mysql_query("delete from unvalid where id=".$id))
	{
		echo '<script>alert("删除成功!")</script>';
	}
}

if(isset($_GET["add"]))
{
	$word=$_GET["add"];
	if(trim($word)!="好的")
	{
		if(mysql_query("insert into unvalid(word) values ('".$word."')"))
		{
			echo '<script>alert("添加成功!")</script>';
		}
	}
	else
	{
		echo '<script>alert("添加失败!")</script>';
	}
	
}

?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
<script type='text/javascript' src="../js/islogin.js" charset="gb2312"></script>
</HEAD>
<BODY>
<center>
<?php 
if($_GET[search_name]){
$search_sql=" and (p_price.p_title like '%$_GET[search_name]%' || p_price.p_info like '%$_GET[search_name]%')";
}
?>
  <table width="60%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
	  <td width="5%" height="30" align="center" bgcolor="#8DA8CF">编号</td>
      <td width="42%" align="center" bgcolor="#8DA8CF">非法词汇</td>
      <td width="17%" align="center" bgcolor="#8DA8CF">已发现次数</td>
      <td width="10%" align="center" bgcolor="#8DA8CF">管理</td>
    </tr>
<?php
$sql="select * from unvalid";

$rs=@mysql_query($sql);
$i=1;
while($row=mysql_fetch_array($rs)){
$color=($i%2)?"#FFFFFF":"#eeeeee";
?>
    <tr bgcolor=<?=$color?>>
      <td height="25" align="center"><?=$row["id"]?></td>
	  <td align="left" style="padding-left:5px;padding:2px;"><?=$row["word"]?></td>
	  <td align="center"><?=$row[nums]?>次</td>
      <td align="center"><a href="unvalid.php?id=<?=$row['id']?>">删除</a></td>
    </tr>
<?php
$i++;}
?>
</table>
<form action="unvalid.php" method="get">
添加非法词汇:<input type="text" size="40" name="add"/><input type="submit" value="添加" />
</form>
</center>
</BODY>
</HTML>

